package com.ruoyi.business.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * 订单对象 orders
 * 
 * @author yipeng
 * @date 2024-09-11
 */
@Document(indexName = "orders", shards = 3, replicas = 2)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Orders extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单号 */
    @TableId
    private Long id;

    /** 核销码【UUID产生、唯一】 */
    @Excel(name = "核销码【UUID产生、唯一】")
    private String verificationCode;

    /** 核销码图片 */
    @Excel(name = "核销码图片")
    private String verificationImg;

    /** 店铺id */
    @Excel(name = "店铺id")
    @Field(name = "mid", type = FieldType.Integer)
    private Long mid;

    /** 用户id */
    @Excel(name = "用户id")
    private Long uid;

    /** 服务详情编号id */
    @Excel(name = "服务详情编号id")
    private Long serviceId;

    /** 服务类别id */
    @Excel(name = "服务类别id")
    private Long serviceTypeId;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    @Field(name = "orderTime", type = FieldType.Date)
    private Date orderTime;

    /** 预约时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date reservationTime;

    /** 订单车辆id号 */
    @Excel(name = "订单车辆id号")
    private Long carId;

    /** 平台优惠卷id【每次只用使用一张】 */
    @Excel(name = "平台优惠卷id【每次只用使用一张】")
    private Long platformCouponId;

    /** 商家优惠卷id【每次只用使用一张】 */
    @Excel(name = "商家优惠卷id【每次只用使用一张】")
    private Long shopCouponId;

    /** 实付金额 */
    @Excel(name = "实付金额")
    @Field(name = "price", type = FieldType.Double)
    private Long price;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /** 使用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date useTime;

    /** 订单状态（0待支付、1待使用、2待评价、3已取消、4已退款、5已完成） */
    @Excel(name = "订单状态", readConverterExp = "0=待支付、1待使用、2待评价、3已取消、4已退款、5已完成")
    private Long status;

    /** 删除状态 */
    @TableLogic
    @Excel(name = "删除状态")
    private Long deleted;

     private  String typename;
    private  String shopname;

}
